package com.zzyl.mapper;

import com.github.pagehelper.Page;
import com.zzyl.dto.ReservationDto;
import com.zzyl.entity.Reservation;
import com.zzyl.vo.ReservationCountVo;
import com.zzyl.vo.ReservationVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.List;

@Mapper
public interface ReservationMapper {
    Integer getCountByCreateBy(Long memberId,LocalDateTime start,LocalDateTime end);

    void addReservation(Reservation reservation);

    Reservation getReservationByCreateByAndTime(String createBy, LocalDateTime time);

    Page<ReservationVo> getReservationPage(@Param("memberId") Long memberId, @Param("dto") ReservationDto dto);

    Reservation getReservationByMobile(ReservationDto dto);

    List<ReservationCountVo> getCountByTime(@Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime);

    void cancelReservation(Long id);

    void reservationOverdue(LocalDateTime now);
}
